package com.deepoove.dubbo.provider.springboot.provider;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.dubbo.config.annotation.Service;
import com.deepoove.swagger.dubbo.example.api.pojo.Person;
import com.deepoove.swagger.dubbo.example.api.pojo.User;
import com.deepoove.swagger.dubbo.example.api.service.AccountService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(value = "帐号服务")
@Service
public class AccountServiceImpl implements AccountService {

	@Override
	@ApiOperation(value = "登出", notes = "退出用户信息")
	public User logout(String account) {
		User u = new User();
		u.setId("f4345463463");
		u.setName("fewgtwrgwrwjfj");
		u.setSite("www.baidu.com");

		return u;
	}

	@Override
	@ApiOperation(value = "登录")
	public boolean login(@ApiParam(value = "用户帐号") String account, @ApiParam(value = "用户密码") String password) {
		return false;
	}

	@Override
	@ApiOperation(nickname = "byCode", value = "登录", notes = "邀请码登录")
	public boolean login(@ApiParam(value = "用户帐号") String account, @ApiParam(value = "邀请码") int code) {
		return false;
	}

	@Override
	public void updateInfo(boolean isBoy, Integer number) {
	}

	@Override
    @ApiOperation(value="获取用户的List")
	public List<User> getUserList(@ApiParam(value = "用户对象") User u, @ApiParam(value = "人对象") Person p) {
		if (p == null)
			p = new Person();
		// System.out.println(p.getUser().getName());
		List<User> list = new ArrayList<User>();
		User user = new User();
		user.setId("11");
		user.setName("zsw11");
		user.setSite("www.wangmenghua11.com");
		User user2 = new User();
		user2.setId("21");
		user2.setName("zsw21");
		user2.setSite("www.wangmenghuaAnd曾少文21.com");
		list.add(user);
		list.add(user2);
		list.add(u);
		return list;
	}

}
